/* 容器样式 */
.container {
  width: 100%;
  height: 100%;
  margin: 0;
  display: flex;
  flex-direction: column;
  background-image: url('/background.png');
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  position: relative;
  /* 为左上角时间提供定位基准 */
}

/* 主要内容区域 - 左右布局 */
.main-content {
  display: flex;
  gap: 52px;
  flex: 1;
  min-height: 0;
  margin-top: 80px;
  /* 给左上角时间显示留出空间 */
  margin-left: 34px;
  /* 给左侧绝对定位按钮栏留出空间 */
}

/* 左侧按钮栏 - 绝对定位 */
.sidebar-buttons {
  position: absolute;
  top: 144px;
  left: 52px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 10px 0;
  z-index: 100;
}

.sidebar-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 10px;
  cursor: pointer;
}


.btn-aicon {
  width: 40px;
  height: 40px;
  display: block;
}

/* 静音/播放按钮图标特殊尺寸 */
.mute-btn .btn-aicon {
  width: 48px;
  height: 48px;
  margin-top: 24px;
}

/* 消息显示区域样式 - 左侧 */
.message-display {
  width: 40%;
  height: 876px;
  padding-top: 52px;
  padding-bottom: 41px;
  color: white;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.message-display h3 {
  margin-top: 0;
  color: white;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

/* 视频容器 */
.video-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 10px 0 0 74px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  position: relative;
}

/* 视频文件名样式 */
.video-name {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 18px;
  font-weight: bold;
  background: rgba(0, 0, 0, 0.6);
  padding: 8px 16px;
  border-radius: 6px;
  z-index: 10;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* 视频播放器样式 */
.video-player {
  width: 100%;
  max-height: 100%;
  border-radius: 10px;
  object-fit: contain;
  /* 保持完整显示不裁切 */
}

/* 图片容器 */
.image-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 10px 0;
}

/* man图片样式 */
.man-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* 保持完整显示不裁切 */
}

/* 聊天区域样式 - 右侧 */
.chat-section {
  width: 53%;
  display: flex;
  flex-direction: column;
  gap: 15px;
  height: 810px;
  margin-top: 33px;
}

/* 顶部标题 */
.chat-header {
  flex-shrink: 0;
  text-align: center;
  padding: 15px 0;
  padding: 15px 0 2px 0;
}

.chat-header h3 {
  margin: 0;
  font-family: Source Han Sans;
  font-size: 20px;
  font-weight: bold;
  line-height: normal;
  text-align: center;
  letter-spacing: 0.05em;
  font-variation-settings: "opsz" auto;
  font-feature-settings: "kern" on;
  color: #D4FFEF;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 80px;
}

/* 标题左右横线 */
.chat-header h3::before,
.chat-header h3::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #06FFB0;
  opacity: 0.3;
}

/* 聊天消息显示区域 */
.chat-messages {
  flex: 1;
  max-height: 600px;
  overflow-y: auto;
  scrollbar-gutter: stable;
  width: calc(100% + 20px);
  /* 增加20px宽度 */
  margin-right: -20px;
  /* 向右扩展20px */
  position: relative;
  /* 为遮罩层提供定位基准 */
}

/* Loading 遮罩层 */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* background: rgba(0, 0, 0, 0.5); */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  backdrop-filter: blur(3px);
}

/* Loading 图片样式 */
.loading-spinner-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

/* 聊天消息区域滚动条样式 - WebKit浏览器 */
.chat-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* 消息列表 */
.message-list {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* 消息项 */
.message-item {
  display: flex;
  flex-direction: row;
  gap: 8px;
  align-items: flex-start;
}

.user-message {
  justify-content: flex-end;
}

.ai-message {
  justify-content: flex-start;
}

/* 思考框消息 - 无头像，占满宽度 */
.thinking-message {
  justify-content: flex-start;
}

.thinking-message .message-content {
  flex: 1;
  width: auto;
  max-width: none;
  margin-right: 12px;
}

/* 结论消息 - 隐藏头像，占满宽度 */
.ai-message:has(.summary-bubble) .message-avatar {
  display: none;
}

.ai-message:has(.summary-bubble) .message-content {
  max-width: 100%;
  width: 100%;
  margin-right: 12px;
}

/* 消息头像 */
.message-avatar {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  overflow: hidden;
}

/* 用户消息头像右边距 */
.user-message .message-avatar {
  margin-right: 12px;
}

/* 头像图片 */
.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 消息内容容器 */
.message-content {
  display: flex;
  flex-direction: column;
  max-width: 74.8%;
}

/* 消息气泡 */
.message-bubble {
  padding: 7px 11px;
  word-wrap: break-word;
  font-size: 14px;
  line-height: 1.4;
}

.user-message .message-bubble {
background: rgba(212, 255, 239, 0.05);
  /* border: 1px solid #FFA100; */
  border-radius: 6px 6px 0px 6px;
  font-family: Source Han Sans;
  font-size: 14px;
  font-weight: normal;
  line-height: normal;
  letter-spacing: 0em;
  font-variation-settings: "opsz" auto;
  font-feature-settings: "kern" on;
  color: #D4FFEF;
}

.ai-message .message-bubble {
  /* background: rgba(0, 0, 0, 0.3); */
  /* border: 1px solid #00CD9A; */
  border-radius: 6px 6px 6px 0px;
  font-family: Source Han Sans;
  font-size: 14px;
  font-weight: normal;
  line-height: normal;
  letter-spacing: 0em;
  font-variation-settings: "opsz" auto;
  font-feature-settings: "kern" on;
  color: #D4FFEF;
}

/* 结论消息气泡样式 */
.summary-bubble {
  background-size: 100% 100% !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-color: transparent !important;
  border: none !important;
  width: 100% !important;
  height: 84px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: left!important;
    padding: 16px 93px !important;
  box-sizing: border-box !important;
}

/* 思考容器 - 统一大框 */
.thinking-container {
  width: 100%;
  /* padding: 10px; */
  /* border-radius: 6px 6px 6px 0px; */
  /* background: rgba(0, 0, 0, 0.1); */
  /* box-sizing: border-box; */
  /* border: 1px solid rgba(212, 255, 239, 0.2); */
  /* backdrop-filter: blur(3px); */
}

/* 思考中标题 */
.thinking-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-left: 7px;
  margin-top: 5px;
  cursor: pointer;
  padding-right: 10px;
  margin-bottom: 10px;
}

.thinking-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.thinking-icon {
  width: 22px;
  height: 18px;
  flex-shrink: 0;
}

.thinking-text {
  font-family: Source Han Sans;
  font-size: 16px;
  font-weight: bold;
  line-height: normal;
  letter-spacing: 0em;
  font-variation-settings: "opsz" auto;
  font-feature-settings: "kern" on;
  background: linear-gradient(180deg, #FFE500 0%, #00FF9D 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 思考内容包裹层 */
.thinking-content-wrapper {
  position: relative;
  margin-left: 18px;
  /* border-left由::after伪元素代替，以便控制起始位置 */
  padding-left: 20px;
  margin-top: 4px;
  padding-bottom: 8px;
}

/* 顶部圆点装饰 */
.thinking-content-wrapper::before {
  content: '';
  position: absolute;
  /* 垂直居中于第一行文字: padding-top(8px) + line-height(16px)/2 - height(8px)/2 = 12px */
  top: 12px;
  /* 水平居中于线条: 线条left(0) + 线条width(1px)/2 - 圆点width(8px)/2 = -3.5px */
  left: -3.5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #D4FFEF;
  box-shadow: 0 0 4px rgba(212, 255, 239, 0.5);
  z-index: 1;
}

/* 左侧线条 */
.thinking-content-wrapper::after {
  content: '';
  position: absolute;
  /* 线条从圆点中心开始向下 */
  top: 16px;
  bottom: 8px;
  left: 0;
  width: 1px;
  background: #D4FFEF;
}

/* 意图理解区域 */
.intent-section {
  width: 100%;
  margin-left: 0;
  margin-bottom: 10px;
}

.intent-header {
  width: 100%;
  padding: 8px 0 ;
  display: flex;
  align-items: center;
  cursor: default;
  transition: all 0.3s ease;
  margin-left: -7px;
}

.intent-header:hover {
  opacity: 1;
}

.intent-left {
  display: flex;
  align-items: center;
  gap: 8px;
}



.intent-title {
  font-family: Source Han Sans;
  font-size: 16px;
  font-weight: bold;
  line-height: 16px;
  letter-spacing: 0em;
  font-variation-settings: "opsz" auto;
  font-feature-settings: "kern" on;
  color: #D4FFEF;
  position: relative;
  display: inline-block;
  z-index: 1;
}

/* 标题底部渐变装饰条 */
.intent-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 134%;
  height: 6px;
  background: linear-gradient(270deg, rgba(0, 255, 157, 0) 0%, #00FF9D 100%);
  opacity: 0.4;
  z-index: -1;
}

.collapse-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.intent-content {
  width: 100%;
  max-height: 370px;
  overflow-y: auto;
  padding: 0 3px;
  border-radius: 6px;
  /* background: rgba(0, 0, 0, 0.08); */
  box-sizing: border-box;
  /* border: 1px solid rgba(212, 255, 239, 0.15); */
}
/* 意图内容区域滚动条样式 - WebKit浏览器 */
.intent-content::-webkit-scrollbar {
  width: 6px;
}

.intent-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

.intent-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.intent-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

.intent-content p {
  margin: 0;
  font-family: Source Han Sans;
  font-size: 14px;
  line-height: 1.6;
  color: #D4FFEF;
}

/* 意图节点样式 */
.intent-node {
  margin-bottom: 12px;
}

.intent-node:last-child {
  margin-bottom: 0;
}

.node-title {
  font-family: Source Han Sans;
  font-size: 13px;
  font-weight: bold;
  line-height: 1.4;
  color: #D4FFEF;
  margin-bottom: 4px;
}

.node-content {
  font-family: Source Han Sans;
  font-size: 14px;
  line-height: 1.6;
  color: #D4FFEF;
  white-space: pre-wrap;
  word-wrap: break-word;
  padding-left: 2em;
  text-indent: -2em;
  position: relative;
}

.node-content::before {
  content: '·';
  display: inline-block;
  width: 2em;
  color: #D4FFEF;
  text-indent: 0;
  line-height: 1;
  vertical-align: middle;
  text-align: center;
}

/* 方案展示智能体不显示小点 */
.node-content.no-bullet {
  padding-left: 0;
  text-indent: 0;
}

.node-content.no-bullet::before {
  display: none;
}


/* 加载指示器 - 旋转圆圈 */
.loading-indicator {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 5px;
  border: 2px solid #D4FFEF;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  vertical-align: text-bottom;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 输入区域 */
.chat-input-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: -2px;
  /* 控制与消息显示区域的间距 */
}

.input-container {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 0 20px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.15);
  box-sizing: border-box;
  border: 1px solid rgba(212, 255, 239, 0.3);
  gap: 10px;
}

.chat-input {
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  color: #D4FFEF;
  font-size: 14px;
  resize: none;
  font-family: inherit;
  line-height: 1.5;
  min-height: 78px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.chat-input::placeholder {
  color: #D4FFEF;
}

.chat-input:focus {
  outline: none;
}

.input-container:focus-within {
  background: rgba(0, 0, 0, 0.2);
  border-color: rgba(212, 255, 239, 0.5);
}

/* textarea 滚动条样式 - WebKit浏览器 */
.chat-input::-webkit-scrollbar {
  width: 6px;
}

.chat-input::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

.chat-input::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.chat-input::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

.send-button {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: white;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  align-self: flex-end;
}

.send-button:hover:not(:disabled) {
  transform: scale(1.1);
}

.send-button:active:not(:disabled) {
  transform: scale(0.95);
}

.send-icon {
  width: 36px;
  height: 36px;
  display: block;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

/* 通用按钮样式 */
button {
  padding: 14px 20px;
  border: none;
  background: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
}

/* 历史记录弹框遮罩层 */
.history-dialog-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: flex-start;
  align-items: center;
  z-index: 1000;
  padding-left: 120px;
  /* 左侧按钮栏的宽度 + 间距 */
}

/* 过渡动画 */
.dialog-fade-enter-active,
.dialog-fade-leave-active {
  transition: opacity 0.3s ease;
}

.dialog-fade-enter-from,
.dialog-fade-leave-to {
  opacity: 0;
}

/* 历史记录弹框 */
.history-dialog {
  width: 251px;
    height: 589px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideInLeft-e77687ce 0.3s ease;
    margin-left: -20px;
    margin-top: -16px;
    border: 1px solid #4d8d7f;
}

@keyframes slideInLeft {
  from {
    transform: translateX(-30px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* 弹框头部 */
.history-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 9px;
  background: #015c49;
  color: white;
  flex-shrink: 0;
  height: 30px;
}

.history-dialog-header h3 {
  font-family: Source Han Sans;
font-size: 14px;
font-weight: 500;
line-height: normal;
letter-spacing: 0em;

font-variation-settings: "opsz" auto;
font-feature-settings: "kern" on;
color: #D4FFEF;
}

/* 关闭按钮 */
.close-btn {
  width: 16px;
  height: 16px;
  border: none;
  color: #D4FFEF;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  padding: 0;
  line-height: 1;
}

.close-btn:hover {
  transform: rotate(90deg);
}

/* 弹框内容区域 */
.history-dialog-content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  background: rgba(2, 40, 35, 0.45);
}

/* 滚动条样式 */
.history-dialog-content::-webkit-scrollbar {
  width: 6px;
}

.history-dialog-content::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
}

.history-dialog-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

.history-dialog-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

/* 历史记录项 */
.history-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 10px 15px;
  margin: 0;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #d4ffef;
}

/* 单数行背景色 */
.history-item:nth-child(odd) {
  background: rgba(255, 255, 255, 0);
}

/* 双数行背景色 */
.history-item:nth-child(even) {
  background: rgba(255, 255, 255, 0.06);
}

.history-item:hover {
  background: rgba(212, 255, 239, 0.1) !important;
}

/* 历史记录图标 */
.history-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
  margin-top: 1px;
}

/* 历史记录信息 */
.history-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.history-name {
  font-size: 14px;
  font-weight: normal;
  color: #d4ffef;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.history-time {
  font-size: 12px;
  color: rgba(212, 255, 239, 0.5);
  line-height: 1.2;
}

/* 加载更多提示 */
.loading-more,
.no-more {
  text-align: center;
  padding: 15px;
  font-size: 13px;
  color: #ffffff8f;
}

.loading-more {
  color: #fff;
}

/* ==================== Markdown 渲染样式 ==================== */
/* 智能体内容区域的 markdown 渲染样式 */
.agent-content {
  font-family: Source Han Sans;
  color: #D4FFEF;
  opacity: 0.7;
}

.agent-content h1,
.agent-content h2,
.agent-content h3,
.agent-content h4,
.agent-content h5,
.agent-content h6 {
  font-family: Source Han Sans;
  font-weight: bold;
  color: #D4FFEF;
  margin: 8px 0 4px 0;
  line-height: 1.4;
}


.agent-content h1 {
  font-size: 20px;
}

.agent-content h2 {
  font-size: 18px;
}

.agent-content h3 {
  font-size: 16px;
}

.agent-content h4 {
  font-size: 15px;
}

.agent-content h5 {
  font-size: 14px;
}

.agent-content h6 {
  font-size: 14px;
}

.agent-content p {
  margin: 4px 0;
  font-size: 14px;
  line-height: 1.6;
  color: #D4FFEF;
}

.agent-content ul,
.agent-content ol {
  margin: 4px 0;
  padding-left: 20px;
  color: #D4FFEF;
}

.agent-content li {
  margin: 2px 0;
  font-size: 14px;
  line-height: 1.6;
  color: #D4FFEF;
}

.agent-content code {
  font-family: 'Courier New', monospace;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 13px;
  color: #D4FFEF;
}

.agent-content pre {
  background: rgba(0, 0, 0, 0.3);
  padding: 10px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 8px 0;
}

.agent-content pre code {
  background: transparent;
  padding: 0;
}

.agent-content blockquote {
  border-left: 3px solid #06FFB0;
  padding-left: 10px;
  margin: 8px 0;
  color: rgba(212, 255, 239, 0.8);
}

.agent-content a {
  color: #06FFB0;
  text-decoration: underline;
}

.agent-content a:hover {
  color: #00FF9D;
}
